|
|
|
|
|
|
|
"MDB", "none")
sSection = sGetINIString(sINIPath, "tables", "table" & nCurTable & _
"INI", "none")
frmWait.lblWait = "Transferring " & sMDBTable
TransferTable sSQLTable, sMDBTable, sSection
Next nCurTable
'THE DATABASE HAS BEEN CREATED, RUN COMMANDS ON IT IF NECESSARY
nCommand = 0
sCommand = ""
While sCommand <> "?"
If nCommand <> 0 Then dbLocal.Execute sCommand
nCommand = nCommand + 1
sCommand = sGetINIString(sINIPath, "General", "Command" & nCommand, "?")
Wend
'CLOSE EVERYTHING DOWN AND END
frmWait.lblWait = "Disconnecting . . ."
dbLocal.Close
dbSQL.Close
Unload frmWait
DoEvents
End
MainError:
frmWait.Hide
Screen.MousePointer = vbDefault
WriteErrMsg "Main - Error " & Err & ": " & Error
End
Exit Sub
End Sub
Sub TransferTable(sSQLTable As String, sLocalTable As String, sSection As _
String)
'This function transfers data from SQL server to an Access table
Dim rstemp As Recordset 'SQL recordset
Dim aTable As Recordset 'Access table
Dim nTemp As Integer ' Counter
Dim nFields As Integer ' variables
Dim nCount As Integer '
Dim sSQL As String 'SQL statement
Dim sTemp As String
On Error GoTo TRTError:
frmWait.ProgressBar1.Visible = True
nCount = 0
frmWait.ProgressBar1.Min = 0
'The user can either transfer a SQL table as-is,
'or the results of a query involving multiple tables. |
|
|
|
|
|